aquí está mi referencia https://github.com/awslabs/aws-mobile-appsync-sdk-js#using-authorization-and-subscription-links-with-apollo-client-v3-no-offline-support que estoy usando versión del cliente apolo 3.x
Aquí está el código.
const auth = { type: 'AMAZON_COGNITO_USER_POOLS', jwtToken: async () => getToken() } const region = 'xx-xxxx-1'; const httpLink = createHttpLink({ uri: URL, }); const authLink = createAuthLink({ url: URL, region: region, auth: auth }) const wsLink = createSubscriptionHandshakeLink({ URL, region, auth }, httpLink) const splitLink = ApolloLink.from([ authLink, wsLink, ]); const apollo_client = new ApolloClient({ link: splitLink, cache: new InMemoryCache(), });